<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>

	<h3>${questionario.descricao}</h3>

	<ul>
		<c:forEach var="pergunta" items="${questionario.perguntas}">
			<li>${pergunta.ordem} - ${pergunta.descricao} - <a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/subir" />">Subir</a>|<a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/descer" />">Descer</a>|<a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/excluir" />">Excluir pergunta</a></li>
			<ul>			
				<c:forEach var="resposta" items="${pergunta.respostas}">
					<li>${resposta.ordem} - ${resposta.descricao} - <a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/respostas/${resposta.id}/subir" />">Subir</a>|<a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/respostas/${resposta.id}/descer" />">Descer</a>|<a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/respostas/${resposta.id}/excluir" />">Excluir resposta</a></li>		
				</c:forEach>
				<li><a href="<spring:url value="/questionarios/${questionario.id}/perguntas/${pergunta.id}/respostas/nova" />">Cadastrar resposta</a></li>
			</ul>
		</c:forEach>
	</ul>

	<a href="<spring:url value="/questionarios" />">Voltar</a>
	<a href="<spring:url value="/questionarios/${questionario.id}/perguntas/nova" />">Nova pergunta</a>
	<a href="<spring:url value="/questionarios/${questionario.id}/liberar" />">Liberar questionário</a>
	
</body>
</html>